-
Notifications
You must be signed in to change notification settings - Fork 6.1k
feat(bun): add GitHub URL support with # version separator #8263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
|
This is interesting, can u update docs too to document it and link to Bun for reference so it's clear where the inspo is coming from (this may be an existing standard i just havent seen it b4) |
|
I will update the docs |
- Support bun add github:username/repo#version syntax - Default to main branch when no version specified for GitHub URLs - Updated tests for GitHub URL handling
- Document github:owner/repo#ref format - Explain supported ref types (branches, tags, commits) - Link to Bun's add-git documentation
|
|
||
| const isGithub = pkg.startsWith("github:") | ||
| // GitHub: default to "main" when no version; npm: default to "latest" | ||
| const pkgVersion = version ?? (isGithub ? "main" : "latest") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const pkgVersion = version ?? (isGithub ? "main" : "latest")
Can u actually do main?
It looks like bun does supports version being empty for the git ones
Fixes #8264
What does this PR do?
Adds support for bun add github:username/repo#version syntax (useful for plugin)
How did you verify your code works?
Using tests